<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title></title>
  <link rel="stylesheet" href="./style.css">
  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/animate.css/4.1.1/animate.min.css">
  <script src="/vue.js"></script>
</head>
<body>
  <div id="root">
    <transition
      enter-active-class="animate__animated animate__headShake"
      leave-active-class="animate__animated animate__tada"
    >
      <div v-if="show">animation</div>
    </transition>
    <br>
    <button @click="handleClick">显示/隐藏</button>
  </div>
  <script>
    var vm = new Vue({
      el: '#root',
      data: {
        show: true
      },
      methods: {
        handleClick() {
          this.show = !this.show
        }
      },
    })
  </script>
</body>
</html>